/**
 * 
 * If you have edited the file, please update
 * all the last-modified fields manually. Thanks!
 *
 * @last-modified by: 
 * @last-modified date: 
 * @last-modified time: 
 *
 * @author Swee Zhi
 * @date-created Sep 12, 2011    @time-created 6:57:41 PM
 *
 * @project: 
 * @module: 
 * @institution: 
 *
 */
package util.enumhelper;

import util.enumeration.JobPosition;
import util.enumeration.Language;

public class LocalizedJobPosition {

    // alphabetical order
    public static String getLocalizedJobPositionAsString(JobPosition jobPosition, String locale) {
        String localizedJobPosition = "";
        
        // en_US ENGLISH, UNITED STATES
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_US))) {
            localizedJobPosition = getJobPosition_EN_US(jobPosition);
        }
        // en_SG ENGLISH, SINGAPORE
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_SINGAPORE))) {
            localizedJobPosition = getJobPosition_EN_SG(jobPosition);
        }
        // ms_MY MALAY, MALAYSIA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.MALAY))) {
            localizedJobPosition = getJobPosition_MS_MY(jobPosition);
        }
        
        // zh_CN CHINESE, CHINA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.CHINESE_CHINA))) {
            localizedJobPosition = getJobPosition_ZH_CN(jobPosition);
        }
        // other language...
        else {
            localizedJobPosition = getJobPosition_EN_US(jobPosition);
        }
        
        return localizedJobPosition;
    }
    
    // simplified chinese (zh_CN)
    private static String getJobPosition_ZH_CN(JobPosition jobPosition) {
        String localizedJobPosition = "";
        
        switch (jobPosition) {
            case MANAGER: localizedJobPosition = "经理" ; break;
            case NORMAL_EMPLOYEE: localizedJobPosition = "普通雇员"; break;
        }
        return localizedJobPosition;
    }
    
    // default (en_US)
    private static String getJobPosition_EN_US(JobPosition jobPosition) {
        String localizedJobPosition = "";
        
        switch (jobPosition) {
            case MANAGER: localizedJobPosition = "Manager" ; break;
            case NORMAL_EMPLOYEE: localizedJobPosition = "Normal Employee"; break;
        }
        return localizedJobPosition;
    }
    
    // singapore english (en_SG)
    private static String getJobPosition_EN_SG(JobPosition jobPosition) {
        String localizedJobPosition = "";
        
        switch (jobPosition) {
            case MANAGER: localizedJobPosition = "Manager" ; break;
            case NORMAL_EMPLOYEE: localizedJobPosition = "Normal Employee"; break;
        }
        return localizedJobPosition;
    }
    
    // bahasa malaysia (ms_MY)
    private static String getJobPosition_MS_MY(JobPosition jobPosition) {
        String localizedJobPosition = "";
        
        switch (jobPosition) {
            case MANAGER: localizedJobPosition = "Pengurus" ; break;
            case NORMAL_EMPLOYEE: localizedJobPosition = "Pekerja Biasa"; break;
        }
        return localizedJobPosition;
    }
    
    // new jobPosition for localized language template (copy and paste to use)
//    private static String getJobPosition_XX_YY(JobPosition jobPosition) {
//        String localizedJobPosition = "";
//        
//        switch (jobPosition) {
//            case CHINESE: localizedJobPosition = "" ; break;
//            case CANTONESE: localizedJobPosition = ""; break;
//            case HAINANESE: localizedJobPosition = ""; break;
//            case HAKKA: localizedJobPosition = ""; break;
//            case HOKKIEN: localizedJobPosition = ""; break;
//            case FUJIAN: localizedJobPosition = ""; break;
//            case SHANGHAI: localizedJobPosition = ""; break;
//            case TEOCHEW: localizedJobPosition = ""; break;
//            case XINJIANG: localizedJobPosition = ""; break;
//            case MALAY: localizedJobPosition = ""; break;
//            case INDIAN: localizedJobPosition = ""; break;
//            case WESTERN: localizedJobPosition = ""; break;
//            case JAPANESE: localizedJobPosition = ""; break;
//            case KOREAN: localizedJobPosition = ""; break;
//        }
//        return localizedJobPosition;
//    }
}
